package com.tgpms.web.earlierStage.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.tgpms.web.earlierStage.entity.TaskDefinition;

/**
* 表TASK_DEFINITION -> null 的基本功能实现
*
* @author DESKTOP-I3TG0H3
* @createDate 2019/11/27
*/
@Mapper
public interface TaskDefinitionMapper {
	
	//删除下级任务
	@Delete("delete from TASK_DEFINITION where TASK_CODE like '${taskCode}%' and PROJECT_ID = #{projectId}")
	int deleteTaskDefinitionByCode(@Param("taskCode")String taskCode,@Param("projectId")String projectId);
	
	//按条件查询任务分解
	List<TaskDefinition> selTaskDefinition(@Param("map")Map<String, Object> map);
	
	//按条件查询树形任务分解
	List<TaskDefinition> selTaskDefinitionForTree(@Param("map")Map<String, Object> map);
	
    /**
     * null  deleteByPrimaryKey 实现
     * 
     * @param id
     * @return null int
     * @author: DESKTOP-I3TG0H3
     * @createDate: 2019-11-27 15:30:29
     */
    int deleteByPrimaryKey(String id);

    /**
     * null  insert 实现
     * 
     * @param record
     * @return null int
     * @author: DESKTOP-I3TG0H3
     * @createDate: 2019-11-27 15:30:29
     */
    int insert(TaskDefinition record);

    /**
     * null  insertSelective 实现
     * 
     * @param record
     * @return null int
     * @author: DESKTOP-I3TG0H3
     * @createDate: 2019-11-27 15:30:29
     */
    int insertSelective(TaskDefinition record);

    /**
     * null  selectByPrimaryKey 实现
     * 
     * @param id
     * @return null com.tgpms.web.earlierStage.entity.TaskDefinition
     * @author: DESKTOP-I3TG0H3
     * @createDate: 2019-11-27 15:30:29
     */
    TaskDefinition selectByPrimaryKey(String id);

    /**
     * null  updateByPrimaryKeySelective 实现
     * 
     * @param record
     * @return null int
     * @author: DESKTOP-I3TG0H3
     * @createDate: 2019-11-27 15:30:29
     */
    int updateByPrimaryKeySelective(TaskDefinition record);

    /**
     * null  updateByPrimaryKey 实现
     * 
     * @param record
     * @return null int
     * @author: DESKTOP-I3TG0H3
     * @createDate: 2019-11-27 15:30:29
     */
    int updateByPrimaryKey(TaskDefinition record);

    List<Map<String, Object>> selReportTable(@Param("map")Map<String, Object> map);
}